|
|
|
|
|
|
|
Figure 12.25
You can display dates in several
formats with the DTPicker control. |
|
|
|
|
|
|
|
|
Another of the Windows common controls is the Slider control. The Slider control provides a means for users to enter numeric data into a program. The slider works like the slider switches you might find on your stereo system's graphic equalizer or in a manner similar to the scrollbars that you have in the standard control set of Visual Basic. |
|
|
|
|
|
|
|
|
See "Scrollbars," p. 78 |
|
|
|
|
|
|
|
|
You create the slider by drawing it on your form. You then can set four main properties that control the appearance of the slider. These properties are summarized in Table 12.4. The effects of these properties are shown in Figure 12.26. |
|
|
|
|
| Table 12.4 Properties of the Slider Control | | Property | Settings | | BorderStyle | Determines the type of border. Set to 0 for no border or 1 for a single-line border. | | Orientation | Determines the orientation of the sliders. Set this property to 0 for a horizontal slider or 1 for a vertical slider. | | TickStyle | Controls the placement of the tick marks on the slider. Set this property to 0 to display tick marks below or to the right of the slider, set it to 1 to place tick marks above or to the left of the slider, set it to 2 to place tick marks on both sides, or set it to 3 to show no tick marks. | | TickFrequency | Determines how many tick marks are displayed. This property can be set to any positive number. |
|
|
|
|
|
|
After you set up the appearance of the slider, you need to set several properties that control its operation. The first two properties are the Min and Max properties, which control the range of values that can be handled by the Slider control. The other two properties are the LargeChange and SmallChange properties. The LargeChange property controls how much the value of the slider changes if users press the PageUp or PageDown keys or click the mouse on either side of the slider bar. The SmallChange property controls how much the value of the slider changes if users press the right or left arrow keys. SelectRange is the final property affecting the operation of the slider. This property determines whether the slider can select only a single value or possibly select a range of values. |
|
|
|
|
|